<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>老师端查看互评的详情列表</title>
		<link rel="stylesheet" text="text.css" href="../../css.api.css"/>
		<link rel="stylesheet" href="../../css/mui.min.css">
		<link rel="stylesheet" type="text/css" href="../../css/base.css">
	</head>
	<style type="text/css" media="screen">
		html, body {
			background-color: #f3f5f7;
		}
		.top-hand-div-style {
			text-align: center;
			background-color: #FFFFFF;
			border: 2px solid #FFFFFF;
			border-radius: 6px;
			margin-right: 10px;
			margin-left: 10px;
			padding-top: 20px;
			padding-bottom: 20px;
		}
		.div-full-screen {
			position: absolute;
			left: 0;
			right: 0;
			top: 0;
			bottom: 50px;
		}
		.div-full-screen2 {
			position: absolute;
			left: 0;
			right: 0;
			top: 280px;
			bottom: 50px;
		}
		.top-hand-img-style {
			width: 120px;
			height: 120px;
			border-radius: 60px;
		}
		.top-hand-span-style {
			display: block;
			/*padding-bottom: 20px;*/
		}
		.bottom-btn-div {
			position: absolute;
			bottom: 0px;
			width: 100%;
			background-color: #18b4ed;
			color: #FFFFFF;
			line-height: 40px;
			text-align: center;
		}
		.colorblue {
			color: #18b4ed;
		}
		#middleId {
			margin-top: 10px;
		}
		/*点击变蓝色高亮*/
		.mui-table-view-cell:active {
			background-color: #FFFFFF;
			color: #333333;
		}
		.top-hand-div-style2 {
			background-color: #FFFFFF;
			border: 2px solid #FFFFFF;
			border-radius: 6px;
			margin-right: 10px;
			margin-left: 10px;
			margin-top: 10px;
			margin-bottom: 50px;
		}
		.middle-div-style2 {
			text-align: center;
		}
		.middle-span-style {
			background: url(../../image/icon_mutualrating_info.png) left center no-repeat;
			background-size: 20px;
			padding-left: 24px;
			line-height: 40px;
		}
		#taiduNum1 > img {
			width: 20px;
		}
		.margin-bottom0 {
			margin-bottom: 0px;
		}
	</style>
	<body>
		<div class="top-hand-div-style" id="topHandId">
			<img src="../../image/icon_head_ask_class.png"  class="top-hand-img-style" id="headImgId"/>
			<span class="base_content_font base_black_grey top-hand-span-style" id="headNameId" > 选择人员</span>
		</div>
		<div class="top-hand-div-style " id="middleId">
			<span class="base_title_font base_black_grey top-hand-span-style" id="headNameId" > <em   id="yNmuId"  class="colorblue">22</em>人已评</span>
			<span class="base_title_font base_black_grey top-hand-span-style" id="headNameId" ><em   id="wNmuId"  class="colorblue">22</em>人未评</span>
			<span class="base_title_font base_black_grey top-hand-span-style" id="headNameId" > 平均得分:<em   id="averageId"  class="colorblue">55</em>分</span>
		</div>
		<div class="top-hand-div-style2" id="top_hand_div_style2">
			<div class="middle-div-style2">
				<span class="base_title_font base_black_grey middle-span-style" id="askNumId" > 详情评分</span>
			</div>
			<ul class="mui-table-view" id="stulist">
				<!--	<li class="mui-table-view-cell base_content_font base_dark_grey">
				李四<span class="right"><div  id="taiduNum1">
				<img src="../../image/icon_xingxingblue01.png" id="imgId">
				<img src="../../image/icon_xingxingblue01.png">
				<img src="../../image/icon_xingxingblue01.png">
				<img src="../../image/icon_xingxingblue01.png">
				<img src="../../image/icon_xingxingblue01.png">
				<img src="../../image/icon_xingxingblue01.png" hidden="hidden">
				</div></span>
				</li>
				<li class="mui-table-view-cell base_content_font base_dark_grey">
				李四<span class="right">80</span>
				</li>
				<li class="mui-table-view-cell base_content_font base_dark_grey">
				李四<span class="right">80</span>
				</li>-->
			</ul>
		</div>
		<!--<div class="bottom-btn-div base_title_font" onclick="enddata()">
		结束评分
		</div>-->
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script src="../../script/jquery.min.js"></script>
	<script src="../../script/common.js"></script>
	<script src="../../script/MD5.js"></script>
	<script src="../../script/requestTool.js"></script>
	<script type="text/javascript" src="../../script/timeStampTool.js"></script>
	<script type="text/javascript" src="../../script/push.js"></script>
	<script type="text/javascript">
		var page = 1;
		var row = 10;
		var refreshCount = 0;
		var pageParam = '';
		apiready = function() {
			pageParam = api.pageParam;
			determineType();
			notice();
			loadData();
			setRefreshHeader();
			setPullUpRefresh();
		    sendBuriedNotifi('0', '老师端互评结果页', '213')
		};
		function notice() {
			api.addEventListener({
				name : 'pushMessage_classroomMessage'
			}, function(ret, err) {
				//			alert(JSON.stringify( ret.value));
				if (MUTUAL_START_TYPE == ret.value.type && $api.getStorage('cfnetppjxid') == ret.value.jid) {
					if (3 == ret.value.status) {
						loadData();
					} else if (2 == ret.value.status) {
						$("#top-hand-div-style2").addClass("margin-bottom0");
					}
				}
			})
			//结束互评
			api.addEventListener({
				name : 'endMutualRating'
			}, function(ret, err) {
				//coding...
				$("#top-hand-div-style2").addClass("margin-bottom0");
			});
		}

		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				uname : $api.getStorage('cfnetppusername'),
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}

		function determineType() {
			var status = pageParam.status;
			if (status == 2) {//结束
				//          $(".bottom-btn-div").hide();
				//          $("#titelid").show();
				$("#top-hand-div-style2").addClass("margin-bottom0");
			}
		}

		//获取数据
		function loadData() {
			showProgress();
			var params = {
				jid : $api.getStorage('cfnetppjxid'),
				//				uid : $api.getStorage('cfnetppuid'),
				tid : 7,
				iid : pageParam.id,
				uid : pageParam.stuid,
				page : page,
				rows : row,
			};
			//			          alert(JSON.stringify(params));
			cfnetppPOST(url_getMutualEvaluation, params, true, function(data, status) {
				//				              alert(JSON.stringify(data));
				hideProgress();
				api.refreshHeaderLoadDone();
				if (status == 'success') {
					if (data.code == 200) {
						var data = data.data;
						setdata(data);
						var students = data.list;
						//						 console.log(JSON.stringify(students));
						if (students != '' && students.constructor == Array && students.length > 0) {
							$('#noData').hide();
							$('#noNet').hide();
							$('#mian').show();
							refreshCount = students.length;
							writelist(students, students.length);
						} else {
							if (page == 1) {
								$('#noData').show();
								$('#noNet').hide();
							}
						}
					} else if (data.code = 108) {
					} else {
					}
				} else {
				}
			});
		}

		function setdata(data) {
			$("#headImgId").attr("src", headImgUrl(data.picurl));
			$("#headNameId").html(data.name);
			$("#yNmuId").html(data.numberscores);
			$("#wNmuId").html(data.nonumberscores);
			$("#averageId").html(data.average);
			//       $("#headImgId").attr("src",httpImgUrl(data.picurl));
		}

		function writelist(listdata, len) {
			var htmls = '';
			for (var i = 0; i < len; i++) {
				var data = listdata[i];
				var scores = parseInt(data.scores) / 20;
				var xingxing = '';
				if (scores == 1) {
					xingxing = '<img src="../../image/icon_xingxingblue.png" >' + '<img src="../../image/icon_xingxingblue01.png">' + '<img src="../../image/icon_xingxingblue01.png">' + '<img src="../../image/icon_xingxingblue01.png">' + '<img src="../../image/icon_xingxingblue01.png">';
				} else if (scores == 2) {
					xingxing = '<img src="../../image/icon_xingxingblue.png" >' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue01.png">' + '<img src="../../image/icon_xingxingblue01.png">' + '<img src="../../image/icon_xingxingblue01.png">';
				} else if (scores == 3) {
					xingxing = '<img src="../../image/icon_xingxingblue.png" >' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue01.png">' + '<img src="../../image/icon_xingxingblue01.png">';
				} else if (scores == 4) {
					xingxing = '<img src="../../image/icon_xingxingblue.png" >' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue01.png">';
				} else if (scores == 5) {
					xingxing = '<img src="../../image/icon_xingxingblue.png" >' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue.png">' + '<img src="../../image/icon_xingxingblue.png">';
				}
				var scroresHtml = '<div  id="taiduNum1" >' + xingxing + '</div>';
				var strhtml = '<li class="mui-table-view-cell base_content_font base_dark_grey">' + data.name + '<span class="right">' + scroresHtml + '</span>' + '</li>';
				$("#taiduNum1 img").eq(scores).prevAll().attr("src", "../../image/icon_xingxingblue.png");
				htmls = htmls + strhtml;
			}
			if (page == 1) {
				$('#stulist').html(htmls);
			} else {
				$('#stulist').append(htmls);
			}
		}

		//		function enddata() {
		//		showProgress();
		//			var params = {
		//
		//				jid : $api.getStorage('cfnetppjxid'),
		//				uid : $api.getStorage('cfnetppuid'),
		//				iid : api.pageParam.id,
		//				tid : 7,
		//				action : 'end',
		//
		//			}
		////				alert(JSON.stringify(params));
		//			cfnetppPOST(url_actionDosign, params, true, function(data, status) {
		////				alert(JSON.stringify(data));
		//				api.hideProgress();
		//				if (status == 'success') {
		//					if (data.code == 200) {
		//			          $("#top-hand-div-style2").addClass("margin-bottom0");
		//					   $(".bottom-btn-div").hide();
		//
		//					}
		//				}
		//			})
		//		}
	</script>
</html>